const Sequelize = require('sequelize')
const sequelize = require('../mysql')
const Page = require('./pageModel')
class Label extends Sequelize.Model { }
Label.init({
  id: {
    type: Sequelize.INTEGER(11).UNSIGNED,
    autoIncrement: true,
    unique: true,
    primaryKey: true
  },
  projectId: {
    type: Sequelize.INTEGER(11).UNSIGNED,
    allowNull: false
  },
  pageId: {
    type: Sequelize.INTEGER(11).UNSIGNED,
    allowNull: false
  },
  label: Sequelize.STRING(1000),
  left: Sequelize.STRING(255),
  top: Sequelize.STRING(255)
}, { sequelize, modelName: 'label' })
Label.belongsTo(Page, { foreignKey: 'pageId', targetKey: 'id' })
// 添加 fk_companyname 到 User
module.exports = Label
